//
//  StudioCourseCollectionViewCell.m
//  Arts1
//
//  Created by 孤星晨宇 on 15/9/23.
//  Copyright (c) 2015年 Arts1. All rights reserved.
//

#import "StudioCourseCollectionViewCell.h"
#import "AllHeader.h"

@implementation StudioCourseCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(0,0, SCREEN_WIDTH - 20, 60)];
        whiteView.backgroundColor = [UIColor whiteColor];
        whiteView.layer.cornerRadius = 5;
        whiteView.layer.masksToBounds = YES;
        [UIView viewShadowColor:whiteView];
        
        _lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 4, 60)];
        //  _lineView.layer.cornerRadius = 5;
        _lineView.backgroundColor = kColorforRandomColor;
//        [UIView viewRediusForTopAndBottomForLeft:_lineView withRedius:5];
        [whiteView addSubview:_lineView];
        
        _titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * RADIO, 0, 200, 30)];
        _titlelabel.text = @"上海视觉艺术学院2016年考试时间安排";
        _titlelabel.font = [UIFont systemFontOfSize:13];
        [whiteView addSubview:_titlelabel];
        
        _detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 , _titlelabel.bottom, 200, 30)];
        _detailLabel.text = @"上海视觉艺术学院2016年考试";
        _detailLabel.font = [UIFont systemFontOfSize:10];
        [whiteView addSubview:_detailLabel];
        
        _applyLabel = [[UILabel alloc] initWithFrame:CGRectMake(whiteView.width - 80 , (whiteView.height - 14)/2.0, 70, 14)];
        _applyLabel.font = [UIFont systemFontOfSize:12];
        _applyLabel.textAlignment = NSTextAlignmentRight;
        _applyLabel.text = @"已报名：";
        [whiteView addSubview:_applyLabel];
        
        [self.contentView addSubview:whiteView];
    }
    return self;
}


- (void)setModel:(SSStateModel *)model{
    _model = model;
    _titlelabel.text = _model.title;
    _detailLabel.text = [NSString stringWithFormat:@"学费价格:%d元/期",(int)_model.applyMoney];

    _applyLabel.text = [NSString stringWithFormat:@"已报名:%@",_model.bookNum];
}



@end
